local json = require "json"
local net = require "net"

function test()
    local fd = net.connect_server()
    local proto = {
        pid = "c2s_add",
        a = 1,
        b = 2,
    }
    local json_proto = json.encode(proto)
    net.send_to_server(fd, json_proto)

    local proto = {
        pid = "c2s_sub",
        a = 10,
        b = 4,
    }
    local json_proto = json.encode(proto)
    net.send_to_server(fd, json_proto)
end

test()